DISCUSSION
The layout cache contains all the layout information ATSUI needs to draw a range of text in a text layout object. This includes caret positions, the memory locations of glyphs, and other information needed to lay out the glyphs. This information is used when ATSUI redraws text that was recently drawn. It uses information in the layout cache to quickly lay out the text. When you clear the layout cache of a line or block of text, it takes ATSUI longer to redraw a line, since glyph layout must be performed again.
The
ATSUClearLayoutCache function flushes the layout cache but does not alter previously set text layout attributes, soft line break positions, or the text memory location. Individual lines may be redrawn as before. If you do not care about retaining these values, you should dispose of the text layout object by calling the
ATSUDisposeTextLayout function.
You should call
ATSUClearLayoutCache when line breaks in a text layout object are altered (for example, if line justification is set to full justification). You can call
ATSUClearLayoutCache to free memory associated with the layout results of a text layout object.
It is not an error if some or all of the lines do not already have layout caches.
ATSUClearLayoutCache only clears the layout caches it can find.